{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: BUSL-1.1
~}}

  <div class="job-editor-alerts">
    {{#if @data.error}}
      <Hds::Alert @type="inline" @color="critical" data-test-error={{@data.error.type}} as |A|>
          <A.Title data-test-error-title>{{conditionally-capitalize @data.error.type true}}</A.Title>
          <A.Description data-test-error-message>{{@data.error.message}}</A.Description>
          {{#if (eq @data.error.message "Job ID does not match")}}
            <A.Button @text="Run as a new job instead" @color="primary" @route="jobs.run" @query={{hash sourceString=@data.job._newDefinition disregardNameWarning=true}} />
          {{/if}}
      </Hds::Alert>
    {{/if}}
    {{#if (and (eq @data.stage "read") @data.hasVariables (eq @data.view "job-spec"))}}
      {{#if this.shouldShowAlert}}
        <Hds::Alert @type="inline" @onDismiss={{this.dismissAlert}} data-test-variable-notification as |A|>
          <A.Title>HCL Variables values may be incomplete</A.Title>
          <A.Description>Nomad cannot ensure that all variable values provided below match those provided on job submit. Ensure the proper values are provided before re-submitting the job.</A.Description>
        </Hds::Alert>
      {{/if}}
    {{/if}}
    {{#if (and (eq @data.stage "edit") (eq @data.view "full-definition"))}}
        <Hds::Alert @type="inline" @color="warning" data-test-json-warning as |A|>
          <A.Title>Edit JSON</A.Title>
          <A.Description>If you edit the JSON formation in the full definition, you will no longer be able to see job spec in HCL.</A.Description>
        </Hds::Alert>
    {{/if}}
    {{#if (and (eq @data.stage "review") @data.shouldShowPlanMessage)}}
      <Hds::Alert @type="inline" @onDismiss={{@fns.onDismissPlanMessage}} as |A|>
          <A.Title data-test-plan-help-title>Job Plan</A.Title>
          <A.Description data-test-plan-help-message>This is the impact running this job will have on your cluster</A.Description>
      </Hds::Alert>
    {{/if}}
  </div>
